<template>
  <div >
    <k-form-design ref='kfd' :showHead='false'/>
  </div>
</template>
<script>
import api from "./js/api"

export default {
  name: "FormDesign",
  props: {},
  data() {
    return {
      refs: this.$refs,
      api: Object.assign(api, this.api),
      isAdd: true,//是否是添加模式
      loaded: false,//是否加载完成
      formItem: this.getFormItem()
    }
  },
  methods: {
    getFormItem() {
      return {
        formId: "",
        formName: ""
      }
    },
    //表单赋值
    setData(data) {
      if (data && data.formId) {
        this.http.get(this, {
          url: this.api.form.get,
          params: {
            formId: data.formId
          },
          success: function(me, data) {
            me.$refs.kfd.handleSetData(JSON.parse(data.formJson))
          }
        })
      }
    },
    //提交表单
    handleSubmit(callback) {
      this.$refs.form.submit({}, callback)
    }
  },
  created() {
  },
  components: {}
}
</script>

<style scoped lang='less' rel='stylesheet/less'>

</style>
